package com.njupt.controller;

import com.njupt.common.pojo.EasyUITreeNode;
import com.njupt.pojo.TbItemCat;
import com.njupt.service.ItemCatService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author: XJL
 * @Description:
 * @Date: Create in 17:13 2018/5/27
 * @Modified By:
 **/
@Controller
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    /**
     * cms查询商品分类信息
     * @param parentId
     * @return
     */
    @ResponseBody
    @RequestMapping("/item/cat/list")
    public List<EasyUITreeNode> getItemCatList(@RequestParam(name = "id",defaultValue = "0") Long parentId){
        List<EasyUITreeNode> list = itemCatService.getCatList(parentId);
        return list;

    }
}
